<?php
/**
 * Created by HBuilder.
 * User: Ason
 * Date: 16-1-6
 * Time: 下午15:51
 */
?>
<div class="modal-dialog modal-lg">
	<form class="form" name="edit" enctype="multipart/form-data" action="<?=site_url('question/do_edit_question').'/'.$q['id'];?>" method="post">
	<div class="modal-content">
		<div class="modal-header bordered-bottom-3 bordered-orange">
			<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
					class="sr-only">Close</span></button>
			<h4 class="modal-title"><span class="glyphicon glyphicon-pencil"></span> 修改题目</h4>
		</div>
		<div class="modal-body">
			<!--错误提示 BEGIN-->
				<div id="edit_alert" class="alert text-center" style="display:none;"></div>
			<!--错误提示 END-->
				<div class="form-group clearfix form-bordered">
	                <label class="control-label col-lg-2 col-md-4 col-xs-3">ID</label>
	                <div class="col-lg-10 col-md-8 col-xs-9">
		                <input type="text" name="id" class="form-control" value="<?=$q['id'];?>" disabled>
	                </div>
                </div>
				<div class="form-group clearfix form-bordered">
					<label class="control-label col-lg-2 col-md-3 col-xs-3">题目难度</label>
					
					<?php for( $i=1; $i <= $setting[ 'level' ]; $i++ ):?>
					<div class="col-lg-1 col-sm-1 col-xs-1">
						<div class="radio">
							<label>
								<input type="radio" name="level" value="<?=$i;?>" <?php if($i==$q['level']) echo 'checked';?>>
								<span class="text"><?=$i;?></span>
							</label>
						</div>
					</div>
					<?php endfor; ?>
					
				</div>
				<div class="form-group clearfix form-bordered">
	                <label class="control-label col-lg-2 col-md-3 col-xs-3">题目描述</label>
	                <div class=" col-lg-10 col-md-9 col-xs-9">
		                <textarea id="q_edit" name="content"></textarea>
	                </div>
                </div>
				<div class="form-group clearfix form-bordered">
					<label class="control-label col-lg-2 col-md-3 col-xs-3">素材附件</label>
					<div class="col-lg-10 col-md-9 col-xs-9">
						<div class="form-group">
							<input type="file" name="attach">
						</div>
					</div>
				</div>
            <div class="clearfix"></div>
		</div>
		<div class="modal-footer">
			<div class="form-group text-right">
				<button class="btn btn-success" type="submit">确认修改</button>&nbsp;&nbsp;&nbsp;&nbsp;
				<button class="btn btn-default" data-dismiss="modal">取消</button>
			</div>
		</div>
	</div>
	</form>
</div>
<script>
//实例化编辑器
    var ue = new UE.ui.Editor();
    ue.render("q_edit");
    ue.ready( function(){
    	ue.setContent( '<?=$q['content'];?>')
    });
</script>